import { PORT1 } from '@/api/config/servicePort'
import http from '@/api'

/**
 * @name 用户管理模块
 */
// 获取用户列表
export const getUserListApi = (params) => {
  return http.get(PORT1 + `/SysUser/PageList`, params)
}
//添加与修改已有用户接口方法
export const reqAddOrUpdateUserApi = (data) => {
  //修改已有用户的数据
  if (data.id) {
    return http.put(PORT1 + `/SysUser/Update`, data)
  } else {
    //新增用户
    return http.post(PORT1 + `/SysUser/Add`, data)
  }
}
// 删除用户
export const reqDeleteUserApi = (id) => {
  return http.delete(PORT1 + `/SysUser/Delete/` + id)
}
export const getOnlineUserListApi = (params) => {
  return http.get(PORT1 + `/OnlineUser/List`, {})
}